package covid;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet;

import java.io.IOException;

public class covidmapper extends Mapper<LongWritable, Text,Text,LongWritable> {
    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text,LongWritable>.Context context) throws IOException, InterruptedException {

        String line =value.toString();
        String[] words= line.split(",");
        Text outkey=new Text(words[2]);

        LongWritable outvalue =new LongWritable(Long.parseLong(words[4]));

        context.write(outkey,outvalue);
    }
}
